<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的反馈</title>
    <style>
        /* 左侧侧边栏样式 */
        .sidebar {
            width: 200px;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            background-color: #333;
            color: white;
            padding-top: 20px;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
        }

        .sidebar h2 {
            margin: 0 0 20px;
            text-align: center;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 50px;
        }

        .sidebar a {
            width: 180px;
            text-align: center;
            color: white;
            text-decoration: none;
            margin: 10px 0;
            padding: 10px;
            border-radius: 5px;
            display: block;
            background-color: #444;
        }

        .sidebar a:hover {
            background-color: #45a049;
        }

        /* 右侧内容样式 */
        .content {
            margin-left: 220px;
            padding: 20px;
        }

        .search-bar {
            display: flex;
            justify-content: flex-start;
            margin-bottom: 20px;
        }

        .search-bar input[type="text"] {
            padding: 8px;
            width: 300px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .search-bar button {
            padding: 8px 15px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 5px;
            margin-left: 10px;
        }

        .search-bar button:hover {
            background-color: #45a049;
        }

        h1 {
            text-align: center;
            color: #333;
            margin: 20px 0;
        }

        textarea {
            resize: none;
        }
        .link {
            color: #4CAF50;
            text-decoration: none;
            font-weight: bold;
        }
        .link:hover {
            text-decoration: underline;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }

        th, td {
            padding: 10px;
            text-align: left;
            border: 1px solid #ddd;
        }

        th {
            background-color: #f2f2f2;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        a {
            color: #4CAF50;
            text-decoration: underline;
        }

        a:hover {
            color: #45a049;
        }
    </style>
</head>
<body>

<!-- 左侧按钮区域 -->
<div class="sidebar">
    <h2>功能导航</h2>
    <a href="/dashboard">返回首页</a>
    <a href="/logout">退出登录</a>
</div>

<!-- 右侧内容区域 -->
<div class="content">
    <h1>我的反馈</h1>

    <table>
        <thead>
        <tr>
            <th>标题</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="feedbackDTO" items="${feedbackDTOList}">
            <tr>
                <td>${feedbackDTO.getTitle()}</td>
                <td>
                    <c:choose>
                        <c:when test="${feedbackDTO.getStatus() == 0}">待处理</c:when>
                        <c:when test="${feedbackDTO.getStatus() == 1}">已处理</c:when>
                        <c:otherwise>关闭</c:otherwise>
                    </c:choose>
                </td>
                <td>
                    <c:if test="${feedbackDTO.getStatus() == 1}">
                        <a class="link" href="ViewReplyController?feedbackId=${feedbackDTO.getFeedback_id()}">查看回复</a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>

    <a class="link" href="interactiveFeature.jsp">返回</a>
</div>

</body>
</html>

